
#include "member_BClock.h"

using namespace BWE;

member_BClock::member_BClock()
{
	startTime = 0;
	tickTime = 0;
	
#ifdef _WINDOWS_SYSTEM_
	LARGE_INTEGER fq;
	bool ret = QueryPerformanceFrequency(&fq);
	frequency = 1.0 / fq.QuadPart;
	htimer = 0;
#endif
}
member_BClock::~member_BClock()
{
#ifdef _WINDOWS_SYSTEM_
	if (htimer)
		CloseHandle(htimer);
#endif
}

#ifdef _WINDOWS_SYSTEM_
double member_BClock::tick()
{
	LARGE_INTEGER time;
	QueryPerformanceCounter(&time);
	return time.QuadPart * frequency;
}
#endif
